package com.lovemanai.test;

import java.util.List;

import org.junit.Test;




import com.lovemanai.dao.DbDao;
import com.lovemanai.model.User;

/**
 * 测试类
 * @author lovemanai
 *
 */
public class Demo1 {
	
	@Test
	public void test1() {
		String sql = "select * from user where id = ?";
		List<User> users = (List<User>) new DbDao().query(sql, User.class,5);
		System.out.println(users.isEmpty());
		for (User user : users) {
			System.out.println(user.getUserName());
		}
	}

	@Test
	public void test2() {
		String sql = "insert into user(username,password) value(?, ?)";
		new DbDao().update(sql, "jerry", "666666");
	}
	
	@Test
	public void test3() {
		String sql = "delete from user where username = ?";
		new DbDao().update(sql, "fuck");
	}
}
